<template>
  <div id="center">
    <div class="up">
      <div class="bg-color-black item" v-for="item in titleItem" :key="item.title">
        <p class="ml-3 colorBlue fw-b">{{item.title}}</p>
        <div>
          <dv-digital-flop :config="item.number" style="width:1.5rem;height:.65rem;" />
        </div>
      </div>
    </div>
    <div class="down">
      <div class="ranking bg-color-black">
        <span style="color:#5cd9e8">
          <icon name="align-left"></icon>
        </span>
        <span class="fs-xl text mx-2 mb-1">停车场应收金额排行榜</span>
        <dv-scroll-ranking-board :config="ranking" style="height:2.75rem" />
      </div>
      <div class="percent">
        <div class="item bg-color-black">
          <span>用户停车缴费率</span>
          <CenterChart :id="rate[0].id" :tips="rate[0].tips" :colorObj="rate[0].colorData" />
        </div>
        <div class="item bg-color-black">
          <span>用户停车逃费率</span>
          <CenterChart :id="rate[1].id" :tips="rate[1].tips" :colorObj="rate[1].colorData" />
        </div>
<!--        <div class="water">-->
<!--          <dv-water-level-pond :config="water" style="height: 1.5rem" />-->
<!--        </div>-->
      </div>
    </div>
  </div>
</template>

<script>
import CenterChart from "@/components/echart/center/centerChartRate";

export default {
  data () {
    return {
      titleItem: [
        {
          title: "今年累计停车收益",
          number: {
            number: [4582342],
            toFixed: 1,
            content: "{nt}"
          }
        },
        {
          title: "本月累计停车收益",
          number: {
            number: [920102],
            toFixed: 1,
            content: "{nt}"
          }
        },
        {
          title: "昨日累计停车收益",
          number: {
            number: [62422],
            toFixed: 1,
            content: "{nt}"
          }
        },
        {
          title: "今年停车订单数",
          number: {
            number: [1142313],
            toFixed: 1,
            content: "{nt}"
          }
        },
        {
          title: "本月停车订单数",
          number: {
            number: [242310],
            toFixed: 1,
            content: "{nt}"
          }
        },
        {
          title: "昨日停车订单数",
          number: {
            number: [13230],
            toFixed: 1,
            content: "{nt}"
          }
        }
      ],
      ranking: {
        data: [
          {
            name: "留学生创业园停车场",
            value: 90.32
          },
          {
            name: "温泉酒店停车场",
            value: 88.23
          },
          {
            name: "奥体中心停车场",
            value: 78.54
          },
          {
            name: "陈家坪停车场",
            value: 72.68
          },
          {
            name: "运动学院停车场",
            value: 71.58
          },
          {
            name: "龙湖停车场",
            value: 70.18
          },
          {
            name: "大石坝停车场",
            value: 70.12
          },
          {
            name: "石马河停车场",
            value: 69.28
          },
          {
            name: "铁山坪停车场",
            value: 66.47
          },
          {
            name: "宏斌路停车场",
            value: 66.16
          }


        ],
        carousel: "single",
        unit: "（万元）"
      },
      water: {
        data: [24, 45],
        shape: "roundRect",
        formatter: "{value}%",
        waveNum: 3
      },
      // 通过率和达标率的组件复用数据
      rate: [
        {
          id: "centerRate1",
          tips: 80,
          colorData: {
            textStyle: "#3fc0fb",
            series: {
              color: ["#00bcd44a", "transparent"],
              dataColor: {
                normal: "#03a9f4",
                shadowColor: "#97e2f5"
              }
            }
          }
        },
        {
          id: "centerRate2",
          tips: 20,
          colorData: {
            textStyle: "#67e0e3",
            series: {
              color: ["#faf3a378", "transparent"],
              dataColor: {
                normal: "#ff9800",
                shadowColor: "#fcebad"
              }
            }
          }
        }
      ]
    };
  },
  components: {
    CenterChart
    // centerChart1,
    // centerChart2
  }
};
</script>

<style lang="scss" scoped>
#center {
  display: flex;
  flex-direction: column;
  .up {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    .item {
      border-radius: 0.0625rem;
      padding-top: 0.2rem;
      margin-top: 0.1rem;
      width: 30%;
      height: 0.875rem;
    }
  }
  .down {
    padding: 0.07rem 0.05rem;
    padding-bottom: 0;
    width: 100%;
    display: flex;
    height: 3.1875rem;
    justify-content: space-between;
    .bg-color-black {
      border-radius: 0.0625rem;
    }
    .ranking {
      padding: 0.125rem;
      width: 59%;
    }
    .percent {
      width: 50%;
      display: flex;
      //flex-wrap: wrap;
      flex-direction: column;
      .item {
        //margin-top: 0.0875rem;
        display: flex;
        justify-content: center;
        align-items:center;
        width: 100%;
        height: 2rem;
        span {
          margin: 0 auto;

        }
      }
      .water {
        width: 100%;
      }
    }
  }
}
</style>
